home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / DirectMusic / MusicTool / echotool.h < prev    next >
C/C++ Source or Header  |  2001-10-31  |  2KB  |  50 lines

  1. //-----------------------------------------------------------------------------
  2. // File: EchoTool.h
  3. //
  4. // Desc: Implements an object based on IDirectMusicTool
  5. //       that provides echoing effects.
  6. //
  7. // Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
  8. //-----------------------------------------------------------------------------
  9. #ifndef _ECHOTOOL_H
  10. #define _ECHOTOOL_H
  11.  
  12. #include <dmusici.h>
  13.  
  14. // Maximum echoes is 4 (the number of extra groups opened
  15. // on the port in helper.cpp)
  16. #define MAX_ECHOES    4
  17.  
  18. class CEchoTool : public IDirectMusicTool
  19. {
  20. public:
  21.     CEchoTool();
  22.     ~CEchoTool();
  23.  
  24. public:
  25. // IUnknown
  26.     virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  27.     virtual STDMETHODIMP_(ULONG) AddRef();
  28.     virtual STDMETHODIMP_(ULONG) Release();
  29.  
  30. // IDirectMusicTool
  31.     HRESULT STDMETHODCALLTYPE Init( IDirectMusicGraph* pGraph );
  32.     HRESULT STDMETHODCALLTYPE GetMsgDeliveryType( DWORD* pdwDeliveryType );
  33.     HRESULT STDMETHODCALLTYPE GetMediaTypeArraySize( DWORD* pdwNumElements );
  34.     HRESULT STDMETHODCALLTYPE GetMediaTypes( DWORD** padwMediaTypes, DWORD dwNumElements) ;
  35.     HRESULT STDMETHODCALLTYPE ProcessPMsg( IDirectMusicPerformance* pPerf, DMUS_PMSG* pDMUS_PMSG );
  36.     HRESULT STDMETHODCALLTYPE Flush( IDirectMusicPerformance* pPerf, DMUS_PMSG* pDMUS_PMSG, REFERENCE_TIME rt );
  37. private:
  38.     long    m_cRef;                // Reference counter
  39.     DWORD    m_dwEchoNum;        // Number of echoes to generate
  40.     MUSIC_TIME    m_mtDelay;        // Delay time between echoes
  41.     CRITICAL_SECTION m_CrSec;    // To make SetEchoNum() and SetDelay() thread-safe
  42.  
  43. public:
  44. // Public class methods
  45.     void    SetEchoNum( DWORD dwEchoNum );
  46.     void    SetDelay( MUSIC_TIME mtDelay );
  47. };
  48.  
  49. #endif // _ECHOTOOL_H
  50.